package serverDB;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class Main {

public static void main(String[] args) {
 Client client = new Client();
 client.setUserId(1);
 client.setUserName("Kermit");
 client.setPassword("frog");
 client.setUserEmail("kermit@muppets.com");

 SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(); 
 Session session = sessionFactory.openSession();
 ClientManager manager = new ClientManager(session);

 manager.saveUser(client);
 System.out.println("User saved with ID = "+ client.getUserId());

 session.flush();
 }
}

